<template>
  <li>
    <img :src="item.pic" alt="" />
    <p>{{ item.title }}</p>
    <button @click.stop="add">加入购物车</button>
  </li>
</template>

<script>
export default {
  props: ["item"],
  data() {
    return {};
  },
  mounted() {},
  methods: {
    add() {
      this.$store.commit("add", this.item);
    },
  },
  components: {},
};
</script>

<style lang="scss"></style>
